package rgbos.forum.persistance;

import java.util.Vector;

import rgbos.forum.domain.Post;
import rgbos.forum.domain.Topic;
import rgbos.forum.domain.User;

public interface PersImpl {
	public abstract void connect();
	public abstract void closeConnection();
	public abstract void createNewTables();
	//Posts:
	public abstract int saveNewPost(Post post,int topicId);
	public abstract boolean modifyPost(Post post);
	public abstract boolean modifyPostBody(int postId,String title,String body);
	public abstract boolean deletePost(int postId);
	public abstract Post getPostById(int postId);
	public abstract Vector<Post> getPosts();

	//Topics:
	public abstract int saveNewTopic(Topic topic);
	public abstract boolean modifyTopic(Topic topic);
	public abstract boolean deleteTopic(int topicId);
	public abstract Topic getTopicById(int topicId);
	public abstract Topic getTopicByPost(int id);
	public abstract Vector<Topic> getTopics();

	//Users:
	public abstract boolean registerNewUser(User newUser);
	public abstract boolean logIn(String userName, String pass);
	public abstract boolean modifyUserDetails(User user);
	public abstract boolean deleteUser(String username);
	public abstract boolean setModerator(String username);
	public abstract boolean setAdmin(String username);
	public abstract boolean checkExistUser(String username);
	public abstract boolean changePermission(String username, int value);
	public abstract boolean checkAdmin(String username);
	public abstract boolean checkModerator(String username);
	public abstract Vector<User> getUsers();
	public abstract Vector<User> getOnlineUsers();
	public abstract void addViewCount(int topicId);
	public abstract boolean setOnlineBit(String userName, int onlineBit);
	public abstract int getOnlineBit(String userName);
	public abstract User getUserByName(String username);
	public abstract void addCulumn(String columnName,String columnType);
	public abstract Vector<Post> getPostsByUser(String username);
	public abstract String getEmailByName(String userName);
	
	//Users-Hours
	public abstract void createUsersHours();
	public abstract boolean incHour(int hour);
	public abstract int[] getHourStats();
	public abstract Vector<String> getUsersName();
	
}
